var ns;
var app = new Vue({
    el: '#app',
    data: {
      form:{
        id:'',
      },
      busBalances:[]
    },
    methods: {
        get_data: function() {
            var that = this;
            var options = {};
            options.action = 'getmallbusinesssettlementbyid';
            options.id=that.form.id;
            ns.post(options, function(succeed, data, err) {
                if (succeed) {
                   //alert(JSON.stringify(data));
                   that.form=data.BusSettlement;
                   that.busBalances=data.busBalances;
                }
            });
        },
        gettime: function(date) {
            var date = new Date(date);
            var YY = date.getFullYear() + '-';
            var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
            var DD = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
            var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
            var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
            var ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
            return YY + MM + DD + " " + hh + mm + ss;
        }
    }
});
apiready = function() {
    api.parseTapmode();
    ns = window.Foresight.Util;
    //alert(api.pageParam.id);
    app.form.id = api.pageParam.id;
    app.get_data();
};
